﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

public class Player
{
    public int x { get; set; }
    public int y { get; set; }
    public string direction = "Down";
    public void DrawPlayerRight()
    {
        direction = "Right";
        Console.ForegroundColor = ConsoleColor.Green;
        Console.SetCursorPosition(this.x, this.y);
        Console.Write(" ");
        Console.SetCursorPosition(this.x + 1, this.y);
        Console.Write((char)2);
        Console.SetCursorPosition(this.x + 2, this.y);
        Console.Write(" ");
        Console.SetCursorPosition(this.x, this.y + 1);
        Console.Write("(");
        Console.SetCursorPosition(this.x + 1, this.y + 1);
        Console.Write((char)3);
        Console.SetCursorPosition(this.x + 2, this.y + 1);
        Console.Write("\\");
        Console.SetCursorPosition(this.x, this.y + 2);
        Console.Write("/");
        Console.SetCursorPosition(this.x + 1, this.y + 2);
        Console.Write(" ");
        Console.SetCursorPosition(this.x + 2, this.y + 2);
        Console.Write(")");
    }
    public void DrawPlayerLeft()
    {
        direction = "Left";
        Console.ForegroundColor = ConsoleColor.Green;
        Console.SetCursorPosition(this.x, this.y);
        Console.Write(" ");
        Console.SetCursorPosition(this.x + 1, this.y);
        Console.Write((char)2);
        Console.SetCursorPosition(this.x + 2, this.y);
        Console.Write(" ");
        Console.SetCursorPosition(this.x, this.y + 1);
        Console.Write("/");
        Console.SetCursorPosition(this.x + 1, this.y + 1);
        Console.Write((char)3);
        Console.SetCursorPosition(this.x + 2, this.y + 1);
        Console.Write(")");
        Console.SetCursorPosition(this.x, this.y + 2);
        Console.Write("(");
        Console.SetCursorPosition(this.x + 1, this.y + 2);
        Console.Write(" ");
        Console.SetCursorPosition(this.x + 2, this.y + 2);
        Console.Write("\\");
    }
    public void DrawPlayerFace()
    {
        direction = "Down";
        Console.ForegroundColor = ConsoleColor.Green;
        Console.SetCursorPosition(this.x, this.y);
        Console.Write(" ");
        Console.SetCursorPosition(this.x + 1, this.y);
        Console.Write((char)2);
        Console.SetCursorPosition(this.x + 2, this.y);
        Console.Write(" ");
        Console.SetCursorPosition(this.x, this.y + 1);
        Console.Write("(");
        Console.SetCursorPosition(this.x + 1, this.y + 1);
        Console.Write((char)3);
        Console.SetCursorPosition(this.x + 2, this.y + 1);
        Console.Write(")");
        Console.SetCursorPosition(this.x, this.y + 2);
        Console.Write(" ");
        Console.SetCursorPosition(this.x + 1, this.y + 2);
        Console.Write((char)19);
        Console.SetCursorPosition(this.x + 2, this.y + 2);
        Console.Write(" ");
    }
    public void DrawPlayerBack()
    {
        direction = "Up";
        Console.ForegroundColor = ConsoleColor.Green;
        Console.SetCursorPosition(this.x, this.y);
        Console.Write(" ");
        Console.SetCursorPosition(this.x + 1, this.y);
        Console.Write((char)1);
        Console.SetCursorPosition(this.x + 2, this.y);
        Console.Write(" ");
        Console.SetCursorPosition(this.x, this.y + 1);
        Console.Write("(");
        Console.SetCursorPosition(this.x + 1, this.y + 1);
        Console.Write((char)3);
        Console.SetCursorPosition(this.x + 2, this.y + 1);
        Console.Write(")");
        Console.SetCursorPosition(this.x, this.y + 2);
        Console.Write(" ");
        Console.SetCursorPosition(this.x + 1, this.y + 2);
        Console.Write((char)19);
        Console.SetCursorPosition(this.x + 2, this.y + 2);
        Console.Write(" ");
    }
    public void Move(string direction)
    {
        if (direction == "Left")
        {
            if (this.x > 1)
            {
                Console.SetCursorPosition(this.x + 2, this.y);
                Console.Write(" ");
                Console.SetCursorPosition(this.x + 2, this.y + 1);
                Console.Write(" ");
                Console.SetCursorPosition(this.x + 2, this.y + 2);
                Console.Write(" ");
                this.x--;
            }
        }
        if (direction == "Right")
        {
            if (this.x < Game.ConsoleWidthMax - 4)
            {
                Console.SetCursorPosition(this.x, this.y);
                Console.Write(" ");
                Console.SetCursorPosition(this.x, this.y + 1);
                Console.Write(" ");
                Console.SetCursorPosition(this.x, this.y + 2);
                Console.Write(" ");
                this.x++;
            }
        }
        if (direction == "Up")
        {
            if (this.y > 1)
            {
                Console.SetCursorPosition(this.x, this.y + 2);
                Console.Write(" ");
                Console.SetCursorPosition(this.x + 1, this.y + 2);
                Console.Write(" ");
                Console.SetCursorPosition(this.x + 2, this.y + 2);
                Console.Write(" ");
                this.y--;
            }
        }
        if (direction == "Down")
        {
            if (this.y < Game.ConsoleHeightMax - 4)
            {
                Console.SetCursorPosition(this.x, this.y);
                Console.Write(" ");
                Console.SetCursorPosition(this.x + 1, this.y);
                Console.Write(" ");
                Console.SetCursorPosition(this.x + 2, this.y);
                Console.Write(" ");
                this.y++;
            }
        }
    }
}